import java.util.*;

public class MainC {
    static int m,n,C;
    static int[] a;
    static int min;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        C = in.nextInt();
        a = new int[n];
        min = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        HashSet<String> map = new HashSet<>(n);
        backtrack(m, 0, new ArrayList<>(),map);
        System.out.println(min);

    }

    public static void backtrack(int pre, int begin, List<Integer> list,HashSet<String> map) {
        StringBuilder sb = new StringBuilder();
        sb.append(pre).append(',').append(begin-1).append(list.size());
        map.add(sb.toString());
        if (list.size() == m && begin == n) {
            int max = Integer.MIN_VALUE;
            for (Integer t : list) {
                max = Math.max(t, max);
            }
            min = Math.min(max, min);
            return;
        }
        if (list.size() == m) {
            return;
        }

        int sum = 0;
        for (int i = begin; i < n; i++) {
            sum += a[i];
            int time = (int) Math.ceil((double) sum / (C));
            list.add(time);
            StringBuilder z = new StringBuilder();
            z.append(begin).append(',').append(i + 1).append(list.size());
            if (!map.contains(z.toString())) {
                backtrack(begin, i + 1, list,map);
            }
            list.remove(list.size() - 1);
        }
    }
}
